package com.jlf.core.output;


import com.jlf.core.error.Code;

/**
 * 自定义的结果异常
 *
 * @author wujr
 * 2021/1/6
 * @version 1.0
 * 变更历史
 * [wujr 2021/1/6 1.0 新增]
 */
public class ResultException extends Exception{
    private Integer error;

    public ResultException(Integer error, String msg){
        super(msg);
        this.error = error;
    }
    public ResultException(Integer error, Exception e){
        super(e);
        this.error = error;
    }
    public ResultException(Code code){
        this(code.getError(), code.getMessage());
    }
    public ResultException(Code code, String message){
        this(code.getError(), message);
    }

    public Integer getError() {
        return this.error;
    }
    public void setError(Integer error){
        this.error = error;
    }
}
